import request from '@/utils/request'

// 查询货主信息列表
export function listCargoOwner(query) {
  return request({
    url: '/wms/cargoOwner/list',
    method: 'get',
    params: query
  })
}

// 查询货主信息详细
export function getCargoOwner(id) {
  return request({
    url: '/wms/cargoOwner/' + id,
    method: 'get'
  })
}

// 新增货主信息
export function addCargoOwner(data) {
  return request({
    url: '/wms/cargoOwner',
    method: 'post',
    data: data
  })
}

// 修改货主信息
export function updateCargoOwner(data) {
  return request({
    url: '/wms/cargoOwner',
    method: 'put',
    data: data
  })
}

// 删除货主信息
export function delCargoOwner(id) {
  return request({
    url: '/wms/cargoOwner/' + id,
    method: 'delete'
  })
}

// 根据货主编码查询货主信息
export function getCargoOwnerByCode(ownerCode) {
  return request({
    url: '/wms/cargoOwner/code/' + ownerCode,
    method: 'get'
  })
}

// 检查货主编码唯一性
export function checkOwnerCodeUnique(ownerCode, id) {
  return request({
    url: '/wms/cargoOwner/checkOwnerCodeUnique',
    method: 'get',
    params: {
      ownerCode: ownerCode,
      id: id
    }
  })
}